package com.example.webdemo.service.impl;

import com.example.webdemo.dao.PhoneCodeMapper;
import com.example.webdemo.model.PhoneCode;
import com.example.webdemo.service.PhoneCodeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author zp
 * @version 1.0
 * @description: PhoneCodeServiceImpl
 * @date 2023/7/31 19:14
 */
@Service
public class PhoneCodeServiceImpl implements PhoneCodeService {
    @Resource
    private PhoneCodeMapper phoneCodeMapper;
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return phoneCodeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(PhoneCode record) {
        record.setCodeStatus(0);
        return phoneCodeMapper.insert(record);
    }

    @Override
    public int insertSelective(PhoneCode record) {
        return phoneCodeMapper.insertSelective(record);
    }

    @Override
    public PhoneCode selectByPrimaryKey(Integer id) {
        return phoneCodeMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(PhoneCode record) {
        return phoneCodeMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(PhoneCode record) {
        return phoneCodeMapper.updateByPrimaryKey(record);
    }

    @Override
    public PhoneCode selectByPhone(String phone) {
        return phoneCodeMapper.selectByPhone(phone);
    }

    @Override
    public int deleteByPhone(String phone) {
        return phoneCodeMapper.deleteByPhone(phone);
    }
}
